Skip to content

Update pedestrian consideration to factor in distance from ego vehicle #1585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025

Conversation

takanotaiga
Copy link
Member

@takanotaiga takanotaiga commented Apr 23, 2025

Abstract

This pull request enhances pedestrian obstacle detection by adding a maximum detection range, so that only pedestrians within a specified distance from the ego vehicle are considered when evaluating lane obstacles.

Background

The previous implementation only checked whether a pedestrian occupied a lane and was ahead, causing the vehicle to react even to distant pedestrians. This could lead to unnecessary stops or unnatural behavior. Introducing a distance threshold ensures more realistic and efficient obstacle detection.

Details

  • Extended the signature of the hasObstacleInPedestrianLanes lambda to accept a new parameter, max_detect_length (maximum detection distance).

  • Calculated the Euclidean distance between the ego vehicle and each pedestrian; only if norm < max_detect_length are the pedestrian’s lane IDs collected.

  • Updated the call within FollowLaneAction::detectObstacleInLane from:

    hasObstacleInPedestrianLanes(pedestrian_lanes)

    to:

    hasObstacleInPedestrianLanes(pedestrian_lanes, 10)

    where 10.0 m is the default detection range.

Before

before.mov

After

after.mov

References

Destructive Changes

N/A

Known Limitations

N/A

@takanotaiga takanotaiga added the bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 label Apr 23, 2025
@takanotaiga takanotaiga self-assigned this Apr 23, 2025
Copy link

github-actions bot commented Apr 23, 2025

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@takanotaiga takanotaiga changed the title DO NOT MERGE Pedestrian consideration to factor in distance from ego vehicle Apr 23, 2025
@takanotaiga takanotaiga changed the title Pedestrian consideration to factor in distance from ego vehicle Update pedestrian consideration to factor in distance from ego vehicle Apr 23, 2025
Copy link

@takanotaiga takanotaiga requested a review from hakuturu583 April 24, 2025 02:46
@takanotaiga takanotaiga marked this pull request as ready for review April 24, 2025 02:46
@hakuturu583 hakuturu583 added bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 and removed bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 labels Apr 24, 2025
@hakuturu583 hakuturu583 merged commit 4d70781 into master Apr 24, 2025
22 checks passed
@github-actions github-actions bot deleted the feature/improve-pedestrian-consideration branch April 24, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 wait for regression test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants